<template>
  <div class="m_swiper">
    <swiper :options="swiperOption" ref="mySwiper" class="m_swiper">
      <!-- slides -->
      <swiper-slide v-for="item in swiperList" :key="item.id">
        <img :src="item.imgUrl" alt class="swiper_img">
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'MSwiper',
  props: {
    swiperList: Array
  },
  data() {
    return {
      swiperOption: {
        autoplay: {
          delay: 3000,
          stopOnLastSlide: false,
          disableOnInteraction: false
        },
        loop: true,
        effect: 'fade',
        pagination: {
          el: '.swiper-pagination'
        }
      }
    }
  }
}
</script>

<style  lang='stylus' scoped>
.m_swiper >>> .swiper-pagination-bullet-active
   background-color #fff
.swiper-container
  height 0
  padding-bottom 33.33%
  overflow hidden
  .swiper_img
    width 100%
</style>
